package com.example.ysdemo.po;

/**
 * @describe 统一响应码
 * @date 2020/9/21
 */
public enum ResultCode {

    /**
     * 成功状态码
     */
    SUCCESS(200, "操作成功!"),


    UNAUTHENTIC(100401, "未登录，请先登录！"),
    TOKEN_ERROR(100402, "未认证，Token错误！"),
    UNAUTHORIZED(100403, "未授权，权限不足！"),
    TOKEN_EXPIRE(100404, "Token已过期！"),
    SHORT_PARAM_ERROR(100600, "请求资源异常"),
    LOGIN_ERROR(100700, "登录失败，请重试！"),
    LAY_OUT_SUCCESS(100800, "退出成功！"),
    CAPTCHA_ERROR(100900, "验证码生成失败，请重试！"),
    CAPTCHA_CHECK_ERROR(101000, "验证码错误，请重试！"),
    PHONE_NUMBER_ILLEGAL(101013,"手机号非法!"),
    SMS_CODE_ERROR(101014,"短信验证码错误!"),
    SMS_CODE_EXPIRE(101015,"短信验证码过期!"),
    PIC_UPLOAD_ERROR(101016,"上传失败，请选择图片!"),

    /**
     * 错误状态码
     */
    ERROR(500, "操作失败!");


    private int code;
    private String message;

    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
